package com.dc.controller;

import com.dc.annotation.Log;
import com.dc.common.ResponseResultVO;
import com.dc.entity.MapManagement;
import com.dc.entity.ro.MapManagementRO;
import com.dc.service.MapManagementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "地图管理")
@RestController
@RequestMapping("/mapManagement")
public class MapManagementController {

    @Resource
    private MapManagementService mapManagementService;

    @Log(title = "地图管理", businessDesc = "增加")
    @ApiOperation(value = "增加", notes = "增加")
    @PostMapping("/insertMapManagement")
    public ResponseResultVO insertMapManagement(@RequestBody MapManagementRO ro) {
        return mapManagementService.insertMapManagement(ro);
    }

    @Log(title = "地图管理", businessDesc = "修改")
    @ApiOperation(value = "修改", notes = "修改")
    @PostMapping("/updateMapManagement")
    public ResponseResultVO updateMapManagement(@RequestBody MapManagementRO ro) {
        return mapManagementService.updateMapManagement(ro);
    }

    @Log(title = "地图管理", businessDesc = "删除")
    @ApiOperation(value = "删除", notes = "删除")
    @GetMapping("/deleteMapManagement")
    public ResponseResultVO deleteMapManagement(@RequestParam String id) {
        return mapManagementService.deleteMapManagement(id);
    }

    @ApiOperation(value = "查询列表", notes = "查询列表")
    @PostMapping("/selectMapManagementList")
    public ResponseResultVO<MapManagement> selectMapManagementList(@RequestBody MapManagementRO ro) {
        return mapManagementService.selectMapManagementList(ro);
    }
}
